package business.global.pk.ddz.cardtype.type;

import business.ddz.c2s.cclass.DDZ_define;
import business.global.pk.alg.params.BaseOpCard;
import business.global.pk.alg.params.BasePKParameter;
import business.global.pk.alg.type.Type_FourWithA;
import business.global.pk.ddz.cardtype.util.DDZALGUtil;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 4带1
 */
public class DDZFourWithA extends Type_FourWithA<DDZALGUtil> {

    private List<Integer> cardTypeList = new ArrayList<>(Arrays.asList(DDZ_define.DDZ_CARD_TYPE.DDZ_CARD_TYPE_NOMARL.value(), DDZ_define.DDZ_CARD_TYPE.DDZ_CARD_TYPE_4DAI1.value()));

    @Override
    public BaseOpCard getCardList(BasePKParameter parameter) {
        if (cardTypeList.contains(parameter.previousOpType)) {
            parameter.targetType = DDZ_define.DDZ_CARD_TYPE.DDZ_CARD_TYPE_4DAI1.value();
            return getBasePKALGUtil().getFourWithA(parameter);
        }
        return null;
    }

    @Override
    public BaseOpCard checkCardList(BasePKParameter parameter) {
        return getBasePKALGUtil().checkFourWithA(parameter);
    }

    @Override
    public DDZALGUtil getBasePKALGUtil() {
        return DDZALGUtil.getInstance();
    }

}
